Optimal. Leaf size=79 \[ \frac {a x}{b^2}-\frac {(a+b x)^2}{6 b^3}-\frac {a \left (3-a^2\right ) \text {ArcTan}(a+b x)}{3 b^3}+\frac {1}{3} x^3 \text {ArcTan}(a+b x)+\frac {\left (1-3 a^2\right ) \log \left (1+(a+b x)^2\right )}{6 b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {5155, 4972,
716, 649, 209, 266} \begin {gather*} -\frac {a \left (3-a^2\right ) \text {ArcTan}(a+b x)}{3 b^3}+\frac {\left (1-3 a^2\right ) \log \left ((a+b x)^2+1\right )}{6 b^3}+\frac {1}{3} x^3 \text {ArcTan}(a+b x)-\frac {(a+b x)^2}{6 b^3}+\frac {a x}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 716
Rule 4972
Rule 5155
Rubi steps
\begin {align*} \int x^2 \tan ^{-1}(a+b x) \, dx &=\frac {\text {Subst}\left (\int \left (-\frac {a}{b}+\frac {x}{b}\right )^2 \tan ^{-1}(x) \, dx,x,a+b x\right )}{b}\\ &=\frac {1}{3} x^3 \tan ^{-1}(a+b x)-\frac {1}{3} \text {Subst}\left (\int \frac {\left (-\frac {a}{b}+\frac {x}{b}\right )^3}{1+x^2} \, dx,x,a+b x\right )\\ &=\frac {1}{3} x^3 \tan ^{-1}(a+b x)-\frac {1}{3} \text {Subst}\left (\int \left (-\frac {3 a}{b^3}+\frac {x}{b^3}+\frac {a \left (3-a^2\right )-\left (1-3 a^2\right ) x}{b^3 \left (1+x^2\right )}\right ) \, dx,x,a+b x\right )\\ &=\frac {a x}{b^2}-\frac {(a+b x)^2}{6 b^3}+\frac {1}{3} x^3 \tan ^{-1}(a+b x)-\frac {\text {Subst}\left (\int \frac {a \left (3-a^2\right )-\left (1-3 a^2\right ) x}{1+x^2} \, dx,x,a+b x\right )}{3 b^3}\\ &=\frac {a x}{b^2}-\frac {(a+b x)^2}{6 b^3}+\frac {1}{3} x^3 \tan ^{-1}(a+b x)+\frac {\left (1-3 a^2\right ) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,a+b x\right )}{3 b^3}-\frac {\left (a \left (3-a^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,a+b x\right )}{3 b^3}\\ &=\frac {a x}{b^2}-\frac {(a+b x)^2}{6 b^3}-\frac {a \left (3-a^2\right ) \tan ^{-1}(a+b x)}{3 b^3}+\frac {1}{3} x^3 \tan ^{-1}(a+b x)+\frac {\left (1-3 a^2\right ) \log \left (1+(a+b x)^2\right )}{6 b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.04, size = 114, normalized size = 1.44 \begin {gather*} \frac {\frac {1}{3} b \left (-\frac {a}{b}+\frac {a+b x}{b}\right )^3 \text {ArcTan}(a+b x)-\frac {1}{3} b \left (-\frac {3 a x}{b^2}+\frac {(a+b x)^2}{2 b^3}-\frac {(1+i a)^3 \log (i-a-b x)}{2 b^3}-\frac {(1-i a)^3 \log (i+a+b x)}{2 b^3}\right )}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 113, normalized size = 1.43
method | result | size |
derivativedivides | \(\frac {-\frac {\arctan \left (b x +a \right ) a^{3}}{3}+\arctan \left (b x +a \right ) a^{2} \left (b x +a \right )-\arctan \left (b x +a \right ) a \left (b x +a \right )^{2}+\frac {\arctan \left (b x +a \right ) \left (b x +a \right )^{3}}{3}+\left (b x +a \right ) a -\frac {\left (b x +a \right )^{2}}{6}+\frac {\left (-3 a^{2}+1\right ) \ln \left (1+\left (b x +a \right )^{2}\right )}{6}+\frac {\left (a^{3}-3 a \right ) \arctan \left (b x +a \right )}{3}}{b^{3}}\) | \(113\) |
default | \(\frac {-\frac {\arctan \left (b x +a \right ) a^{3}}{3}+\arctan \left (b x +a \right ) a^{2} \left (b x +a \right )-\arctan \left (b x +a \right ) a \left (b x +a \right )^{2}+\frac {\arctan \left (b x +a \right ) \left (b x +a \right )^{3}}{3}+\left (b x +a \right ) a -\frac {\left (b x +a \right )^{2}}{6}+\frac {\left (-3 a^{2}+1\right ) \ln \left (1+\left (b x +a \right )^{2}\right )}{6}+\frac {\left (a^{3}-3 a \right ) \arctan \left (b x +a \right )}{3}}{b^{3}}\) | \(113\) |
risch | \(-\frac {i x^{3} \ln \left (1+i \left (b x +a \right )\right )}{6}+\frac {i x^{3} \ln \left (1-i \left (b x +a \right )\right )}{6}+\frac {a^{3} \arctan \left (b x +a \right )}{3 b^{3}}-\frac {x^{2}}{6 b}-\frac {a^{2} \ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right )}{2 b^{3}}+\frac {2 a x}{3 b^{2}}-\frac {a \arctan \left (b x +a \right )}{b^{3}}+\frac {\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right )}{6 b^{3}}\) | \(126\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 85, normalized size = 1.08 \begin {gather*} \frac {1}{3} \, x^{3} \arctan \left (b x + a\right ) - \frac {1}{6} \, b {\left (\frac {b x^{2} - 4 \, a x}{b^{3}} - \frac {2 \, {\left (a^{3} - 3 \, a\right )} \arctan \left (\frac {b^{2} x + a b}{b}\right )}{b^{4}} + \frac {{\left (3 \, a^{2} - 1\right )} \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{b^{4}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.97, size = 66, normalized size = 0.84 \begin {gather*} -\frac {b^{2} x^{2} - 4 \, a b x - 2 \, {\left (b^{3} x^{3} + a^{3} - 3 \, a\right )} \arctan \left (b x + a\right ) + {\left (3 \, a^{2} - 1\right )} \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{6 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.30, size = 117, normalized size = 1.48 \begin {gather*} \begin {cases} \frac {a^{3} \operatorname {atan}{\left (a + b x \right )}}{3 b^{3}} - \frac {a^{2} \log {\left (a^{2} + 2 a b x + b^{2} x^{2} + 1 \right )}}{2 b^{3}} + \frac {2 a x}{3 b^{2}} - \frac {a \operatorname {atan}{\left (a + b x \right )}}{b^{3}} + \frac {x^{3} \operatorname {atan}{\left (a + b x \right )}}{3} - \frac {x^{2}}{6 b} + \frac {\log {\left (a^{2} + 2 a b x + b^{2} x^{2} + 1 \right )}}{6 b^{3}} & \text {for}\: b \neq 0 \\\frac {x^{3} \operatorname {atan}{\left (a \right )}}{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.86, size = 102, normalized size = 1.29 \begin {gather*} \frac {\ln \left (a^2+2\,a\,b\,x+b^2\,x^2+1\right )}{6\,b^3}+\frac {x^3\,\mathrm {atan}\left (a+b\,x\right )}{3}-\frac {x^2}{6\,b}-\frac {a^2\,\ln \left (a^2+2\,a\,b\,x+b^2\,x^2+1\right )}{2\,b^3}+\frac {a^3\,\mathrm {atan}\left (a+b\,x\right )}{3\,b^3}-\frac {a\,\mathrm {atan}\left (a+b\,x\right )}{b^3}+\frac {2\,a\,x}{3\,b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________